package com.young.design.pattern.adapter;

/**
 * @ClassName : JapanPowerAdapter
 * @Author : hyy
 * @Date: 2020-03-16
 */
public class JapanPowerAdapter implements DC5Adapter {
    private final int input = 110;
    @Override
    public boolean support(AC ac) {
        if (input==ac.output()){
            return true;
        }
        return false;
    }

    @Override
    public int outputDC5V(AC ac) {
        if (support(ac)){
            System.out.println("japan 110AC adapter to 5DC");
            return ac.output()/22;
        }
        return 0;
    }
}
